<script setup>
import { DataLine, Money, TrendCharts, House } from '@element-plus/icons-vue'
import LayoutWithNav from '../components/LayoutWithNav.vue'
</script>

<template>
  <LayoutWithNav>
    <div class="my-home-container">
      <!-- 顶部标题区域 -->
      <div class="header-section">
        <h1>提前了解我家的</h1>
        <h2 class="purple-text">估价与行情</h2>
      </div>

      <!-- 估价卡片区域 -->
      <div class="valuation-card">
        <h3>快速了解我的房子价值</h3>
        
        <!-- 功能图标区域 -->
        <div class="feature-icons">
          <div class="feature-item">
            <el-icon><DataLine /></el-icon>
            <span>共享大数据</span>
          </div>
          <div class="feature-item">
            <el-icon><Money /></el-icon>
            <span>每周看估值</span>
          </div>
          <div class="feature-item">
            <el-icon><TrendCharts /></el-icon>
            <span>行情早知道</span>
          </div>
        </div>

        <!-- 估价按钮 -->
        <el-button type="primary" class="valuation-button">去估价</el-button>
      </div>

      <!-- 小区动态区域 -->
      <div class="community-stats">
        <h3>我家小区动态</h3>
        <div class="stats-grid">
          <div class="stat-item">
            <div class="stat-icon">
              <el-icon><House /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-value">**套</div>
              <div class="stat-label">在售数量</div>
            </div>
          </div>
          <div class="stat-item">
            <div class="stat-icon">
              <el-icon><House /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-value">**套</div>
              <div class="stat-label">在租数量</div>
            </div>
          </div>
          <div class="stat-item">
            <div class="stat-icon">
              <el-icon><Money /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-value">**元/m²</div>
              <div class="stat-label">成交均价</div>
            </div>
          </div>
          <div class="stat-item">
            <div class="stat-icon">
              <el-icon><Money /></el-icon>
            </div>
            <div class="stat-content">
              <div class="stat-value">**元/m²</div>
              <div class="stat-label">同城区成交均价</div>
            </div>
          </div>
        </div>
      </div>

      <!-- 挂牌均价区域 -->
      <div class="listing-price">
        <h3>挂牌均价</h3>
        <div class="price-legend">
          <span class="legend-item">
            <span class="dot yellow"></span>
            同小区
          </span>
          <span class="legend-item">
            <span class="dot purple"></span>
            同城区
          </span>
        </div>
        <!-- 这里可以添加价格走势图表 -->
        <div class="price-chart">
          <el-empty description="添加房产解锁更多行情">
            <el-button type="primary">添加房产</el-button>
          </el-empty>
        </div>
      </div>
    </div>
  </LayoutWithNav>
</template>

<style scoped>
.my-home-container {
  padding: 20px;
  background-color: #f5f5f5;
  min-height: 100vh;
}

.header-section {
  margin-bottom: 20px;
}

.header-section h1 {
  font-size: 24px;
  margin: 0;
  color: #333;
}

.purple-text {
  color: #800080;
  font-size: 28px;
  margin: 8px 0;
}

.valuation-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.valuation-card h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #333;
}

.feature-icons {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.feature-item .el-icon {
  font-size: 24px;
  color: #800080;
}

.valuation-button {
  width: 100%;
  background-color: #800080;
  border: none;
  height: 44px;
  font-size: 16px;
}

.community-stats {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.community-stats h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #333;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: #f0e6f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #800080;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.stat-label {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.listing-price {
  background: white;
  border-radius: 12px;
  padding: 20px;
}

.listing-price h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #333;
}

.price-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.yellow {
  background-color: #ffd700;
}

.dot.purple {
  background-color: #800080;
}

.price-chart {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
</style> 